package cn.jobstart.enums;

/**
*    @author sunke
*    @Date 2023-09-06 14:17:03
*    @description 薪资标识
*/
import cn.jobstart.pubInter.EnumVO;
import java.util.ArrayList;
import java.util.List;

public enum AdminJobSalaryFlagEnum {

    SALARY_0(0, "不限") ,
    SALARY_999(999, "1千以下") ,
    SALARY_1999(1999, "1-2千") ,
    SALARY_2999(2999, "2-3千") ,
    SALARY_3999(3999, "3-4千") ,
    SALARY_4999(4999, "4-5千") ,
    SALARY_5999(5999, "5-6千") ,
    SALARY_7999(7999, "6-8千") ,
    SALARY_9999(9999, "0.8-1万") ,
    SALARY_14999(14999, "1-1.5万") ,
    SALARY_19999(19999, "1.5万-2万") ,
    SALARY_29999(29999, "2万-3万") ,
    SALARY_49999(49999, "3万-5万") ,
    SALARY_50000(50000, "5万以上") ; 




    private Integer type;
    private String desc;

    AdminJobSalaryFlagEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDescByType(Integer type) {
        if(type==null ){
            type=0;
        }
        for (AdminJobSalaryFlagEnum var : AdminJobSalaryFlagEnum.values()) {
            if (type==var.getType().intValue())
                return var.getDesc();
             }
        return AdminJobSalaryFlagEnum.values()[0].getDesc();
    }

    public static List<EnumVO> getDescs() {
        List list = new ArrayList();

        for (AdminJobSalaryFlagEnum var : AdminJobSalaryFlagEnum.values()) {
            EnumVO enumVO = new EnumVO();
            enumVO.setId(var.getType()+"");
            enumVO.setName(var.getDesc());
            list.add(enumVO);
        }


        return list;
    }

}
